﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;

namespace WebSys.UI
{
    public class fwbuchangjuedingprint : Page
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        MPPersistence Persistence1; Panel panel1;
        Label txt字, txt第, txt号, txt区, txt公司, txt门牌号, 门牌号1, 门牌号2, txt被征收人, 字1, 第1, 号2, 号3, 号5, 区1, 区2, 区3, 区4, 区5, 区6, 公司1, 被征收人1, 被征收人2, 被征收人3, 被征收人4;
        Label 日期;
        Label txt日期;
        Label txt征收人;
        Label txt年份;
        //Label txt地址, txt代表人, txt职务, txt被征收人, txt住所地, txt危旧房, txt年, txt月, txt日;
        //Label 区1, 字1, 第1, 号2, txt门牌号, 区2, txt公司, 区3, 号3, 区4, 门牌号1, 年1, txt性质, txt丘号;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            NameInfo();
            panel1 = (Panel)FindControl("panel1");
            Persistence1 = (MPPersistence)FindControl("Persistence1");
            if (!base.Page.IsPostBack)
            {

                Persistence1.Table = "zs_征收补偿决定书";//数据库中对应的表
                Persistence1.Key = "IID";//表的主键列名称
                Persistence1.KeyValue = HttpContext.Current.Request.QueryString["IID"];//主键列的值
                Persistence1.ConnStr = _EluZSDataProvider.GetConnectionString();//数据库连接字符串
            }
            Persistence1.BindControl = panel1;//持久化控件的控制对象为Panel中的所以的字段，panel1是Panel的ID
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            Label txtIID = (Label)FindControl("txtIID");
            txtIID.Text = HttpContext.Current.Request.QueryString["IID"];
            字1.Text = txt字.Text.Trim();
            第1.Text = txt第.Text.Trim();
            号2.Text = txt号.Text.Trim();
            号3.Text = txt号.Text.Trim();
            号5.Text = txt号.Text.Trim();
            区1.Text = txt区.Text.Trim();
            区2.Text = txt区.Text.Trim();
            区3.Text = txt区.Text.Trim();
            区4.Text = txt区.Text.Trim();
            区5.Text = txt区.Text.Trim();
            区6.Text = txt区.Text.Trim();
            公司1.Text = txt公司.Text.Trim();
            被征收人1.Text = txt被征收人.Text.Trim();
            被征收人2.Text = txt被征收人.Text.Trim();
            被征收人3.Text = txt被征收人.Text.Trim();
            被征收人4.Text = txt被征收人.Text.Trim();
            门牌号1.Text = txt门牌号.Text.Trim();
            门牌号2.Text = txt门牌号.Text.Trim();
            日期.Text = (string.IsNullOrEmpty(txt日期.Text.Trim())) ? txt日期.Text.Trim() : txt日期.Text.Trim().Substring(0, 10);
            txt年份.Text = txt年份.Text.Trim();
        }

        protected void NameInfo()
        {
            txt区 = (Label)FindControl("txt区");
            txt字 = (Label)FindControl("txt字");
            txt第 = (Label)FindControl("txt第");
            txt号 = (Label)FindControl("txt号");

            txt公司 = (Label)FindControl("txt公司");
            txt门牌号 = (Label)FindControl("txt门牌号");
            txt被征收人 = (Label)FindControl("txt被征收人");
            字1 = (Label)FindControl("字1");
            第1 = (Label)FindControl("第1");
            号2 = (Label)FindControl("号2");
            号3 = (Label)FindControl("号3");
            号5 = (Label)FindControl("号5");
            区1 = (Label)FindControl("区1");
            区2 = (Label)FindControl("区2");
            区3 = (Label)FindControl("区3");
            区4 = (Label)FindControl("区4");
            区5 = (Label)FindControl("区5");
            区6 = (Label)FindControl("区6");
            公司1 = (Label)FindControl("公司1");
            被征收人1 = (Label)FindControl("被征收人1");
            被征收人2 = (Label)FindControl("被征收人2");
            被征收人3 = (Label)FindControl("被征收人3");
            被征收人4 = (Label)FindControl("被征收人4");
            门牌号1 = (Label)FindControl("门牌号1");
            门牌号2 = (Label)FindControl("门牌号2");
            日期 = (Label)FindControl("日期");
            txt日期 = (Label)FindControl("txt日期");
            txt征收人 = (Label)FindControl("txt征收人");

            txt年份 = (Label)FindControl("txt年份");
        }
    }
}


